//
//  BaseTabBarController.m
//  DongQiuDI
//
//  Created by mac on 16/6/21.
//  Copyright © 2016年 Czj. All rights reserved.
//

#import "BaseTabBarController.h"

@interface BaseTabBarController ()

@end

@implementation BaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (instancetype)init {

    self = [super init];
    if (self) {
        
        [self loadSubViewControllers];
    }
    return self;
}

//从storyboard加载子控制器
- (void)loadSubViewControllers {


    NSArray *storyboardNames = @[@"HomeStoryboard",
                                 @"LiveStoryboard",
                                 @"FollowStoryboard",
                                 @"CircleStoryboard",
                                 @"DataStoryboard"];
    NSMutableArray *navigationCtls = [[NSMutableArray alloc] init];
    
    for (NSString *storyboardName in storyboardNames) {
        
      UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:[NSBundle mainBundle]];
        UINavigationController *navigationCtl = [storyboard instantiateInitialViewController];
        [navigationCtls addObject:navigationCtl];
    }
    
    self.viewControllers = [navigationCtls copy];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
